From 8426955edc2723b1288f1f7a9e944ebe42e154f2 Mon Sep 17 00:00:00 2001 From: "ewan@localhost.localdomain" Date: Mon, 16 Apr 2007 16:12:33 -0400 Subject: [PATCH] Added documentation and C bindings for VM.migrate call. Signed-off-by: Ewan Mellor --- docs/xen-api/xenapi-datamodel.tex | 41 +++++++++++++++++++++++++++++++ tools/libxen/include/xen_vm.h | 8 ++++++ tools/libxen/src/xen_vm.c | 20 +++++++++++++++ 3 files changed, 69 insertions(+) diff --git a/docs/xen-api/xenapi-datamodel.tex b/docs/xen-api/xenapi-datamodel.tex index 39055b8d89..78cc917a6e 100644 --- a/docs/xen-api/xenapi-datamodel.tex +++ b/docs/xen-api/xenapi-datamodel.tex @@ -1733,6 +1733,47 @@ void +\vspace{0.3cm} + +\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE} + +\vspace{0.6cm} +\subsubsection{RPC name:~migrate} + +{\bf Overview:} +Migrate the VM to another host. This can only be called when the specified +VM is in the Running state. + + \noindent {\bf Signature:} +\begin{verbatim} void migrate (session_id s, VM ref vm, string dest, bool live, (string -> string) Map options)\end{verbatim} + + +\noindent{\bf Arguments:} + + +\vspace{0.3cm} +\begin{tabular}{|c|c|p{7cm}|} + \hline +{\bf type} & {\bf name} & {\bf description} \\ \hline +{\tt VM ref } & vm & The VM \\ \hline + +{\tt string } & dest & The destination host \\ \hline + +{\tt bool } & live & Live migration \\ \hline + +{\tt (string $\rightarrow$ string) Map } & options & Other parameters \\ \hline + +\end{tabular} + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +void +} + + + \vspace{0.3cm} \noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE} diff --git a/tools/libxen/include/xen_vm.h b/tools/libxen/include/xen_vm.h index 54abe1ba82..d33f31b860 100644 --- a/tools/libxen/include/xen_vm.h +++ b/tools/libxen/include/xen_vm.h @@ -876,6 +876,14 @@ extern bool xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger); +/** + * Migrate the VM to another host. This can only be called when the + * specified VM is in the Running state. + */ +extern bool +xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options); + + /** * Return a list of all the VMs known to the system. */ diff --git a/tools/libxen/src/xen_vm.c b/tools/libxen/src/xen_vm.c index 6f88a9239a..d2a4309a0d 100644 --- a/tools/libxen/src/xen_vm.c +++ b/tools/libxen/src/xen_vm.c @@ -1691,6 +1691,26 @@ xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger) } +bool +xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vm }, + { .type = &abstract_type_string, + .u.string_val = dest }, + { .type = &abstract_type_bool, + .u.bool_val = live }, + { .type = &abstract_type_string_string_map, + .u.set_val = (arbitrary_set *)options } + }; + + xen_call_(session, "VM.migrate", param_values, 4, NULL, NULL); + return session->ok; +} + + bool xen_vm_get_all(xen_session *session, struct xen_vm_set **result) { -- 2.30.2